package com.study.spark.scala.chapter07

import scala.collection.mutable

object Scala12_Collection_Par{
  def main(args: Array[String]): Unit = {
    // TODO 集合 - 并行 par
    val result1 = (0 to 100).map{x => Thread.currentThread.getName}
    val result2 = (0 to 100).par.map{x => Thread.currentThread.getName}

//    println(result1)//Vector(main, main, main, main, main, main, main, ma......
    // 由多个线程并行执行
    println(result2)
    //ParVector(scala-execution-context-global-12, scala-execution-context-global-12, scala-ex


  }
}
